home *** CD-ROM | disk | FTP | other *** search
- // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
- /* $Id: COMShdr.cpp 1.1 1996/07/19 00:15:20 Damien Exp $ */
-
- // Shader COM Object
-
- #ifndef __COMSHDR__
- #include "COMShdr.H"
- #endif
-
- #ifndef __3DCOFAIL__
- #include "3DCoFail.h"
- #endif
-
- #undef INTERFACE
- #define INTERFACE COMShader
- COMShader::COMShader() {
- fcRef=0; // No reference used, so 0 in the Reference counter
- }
-
- COMShader::~COMShader() {
- }
-
- // IUnknown methods of COMShader :
- HRESULT COMShader::QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj) {
- *ppvObj=NULL;
-
- // The COMShader knows the interfaces of the parent Objects
- if (IsEqualIID(riid, IID_IUnknown))
- *ppvObj=(LPVOID)this;
- else if (IsEqualIID(riid, IID_I3DExShader))
- *ppvObj=(LPVOID)this;
- else if (IsEqualIID(riid, IID_I3DExDataExchanger))
- *ppvObj=(LPVOID)this;
- else if (IsEqualIID(riid, IID_I3DExtension))
- *ppvObj=(LPVOID)this;
-
- // we must add reference if we return an interface
- if (*ppvObj!=NULL) {
- ((LPUNKNOWN)*ppvObj)->AddRef();
- return NOERROR;
- }
- else {
- return ResultFromScode(E_NOINTERFACE);
- }
- }
-
- // Add a reference to know how much pointer are initialised on this object
- ULONG COMShader::AddRef(THIS) {
- return ++fcRef;
- }
-
- ULONG COMShader::Release(THIS) {
- ULONG UnreleaseRef; // Number of unrelease reference
-
- UnreleaseRef= --fcRef;
- if (fcRef==0) {
- delete this; // No reference left so delete this COMShader
- }
- return UnreleaseRef;
- }
-
- HRESULT COMShader::ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities) {
- InitCoFailure(shellUtilities);
- return NOERROR;
- }
-
-
- // Called when the Shell modified the Properties Datas
- HRESULT COMShader::ExtensionDataChanged(THIS) {
- fPreprocessed=FALSE;
- return NOERROR;
- }
-
- // Special function when you create a special resource file/item
- HRESULT COMShader::HandleEvent(THIS_ ULONG sourceID) {
- return ResultFromScode(E_NOTIMPL);
- }
-
- HRESULT COMShader::DoShade(THIS_ ShadingInOut* theShadingIO, ShadingElem* theShadingElem) {
- return ResultFromScode(E_NOTIMPL);
- }
-
- // Did the COMShader depends on the UV Space
- BOOLEAN COMShader::DependsOnAppliedExtent(THIS) {
- return FALSE;
- }
-
- void COMShader::CopyData(COMShader* dest) {
- dest->fPreprocessed = fPreprocessed; // Copy data to make a clone
- }
-
-